<div align="center"><h3>Cargos dispon&iacute;veis</h3></div>
<br />
<div id="listaCargos">
      <form id="formCargos">
          <div id="container">

            <div class="demo_jui">
                <table cellpadding="0" cellspacing="0" border="0" class="display" id="ds_cargos" >
                    <thead class="l">
                        <tr style="text-transform: uppercase;">

                            <th>Selecione</th>
                            <th>C&oacute;digo</th>
                            <th>Descri&ccedil;&atilde;o</th>

                        </tr>
                    </thead>
                    <tbody>

                        <?php

                        foreach ($cargosList->getResult() as $value) {

                        ?>

                        <tr class="gradeA" style="font-size: 10px ; border: #000 1px solid " id="tr_<?php echo $value->getCargoCod(); ?>">

                                <td>
                                    <div align="center">
                                        <input type="radio" id="rd_cargo" value="<?php echo $value->getCargoCod().'@'.utf8_encode($value->getCargoDesc()); ?>" />
                                    </div>
                                </td>
                                <td>
                                    <div align="center" id="titulo_<?php echo $value->getCargoCod(); ?>"><?= $value->getCargoCod(); ?></div>
                                </td>
                                <td>
                                    <div align="center" id="desc_<?php echo $value->getCargoCod(); ?>"><?= utf8_encode($value->getCargoDesc()); ?></div>
                                </td>

                             </tr>

                        <?php  } ?>

                    </tbody>


                </table>

            </div>
            <div class="spacer"></div>
        </div><br />
          <div align="center"><input type="button" id="btnCargos" value="Incluir Cargo" /></div>
    </form>
</div>
<script>
    $(document).ready(function() {
        oTable = $('#ds_cargos').dataTable({
            "bJQueryUI": true,
            "sPaginationType": "full_numbers"
        });

  

    });
    
    $('#btnCargos').click(function(){
        
        var cargo = $("input[type=radio][id=rd_cargo]:checked").val();
        
        var nCargo = cargo.split("@");
        
        $('#cCargo').append('<b> - '+nCargo[1]+'</b><br />');
        $('#cCargoVazio').remove();
        $('#novoCargoFunc').append('<input readonly size="40" type="hidden" id="cCargo_'+nCargo[0]+'" class="cargos" value="'+nCargo[0]+'" />');
//        $('#cCargo').remove();
        
        jQuery(document).trigger('close.facebox');
        
    });

</script>
